package com.copm.ifm.servers.sys.mapper;

import com.copm.ifm.servers.sys.entity.SysCategoryType;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.copm.ifm.servers.sys.entity.SysEquipmentType;
import com.copm.ifm.servers.sys.vo.SysCategoryTypeVO;
import com.copm.ifm.servers.sys.vo.SysEquipmentTypeVO;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * 类型分类表(5张表总表，根据type进行区分) Mapper 接口
 * </p>
 *
 * @author tp
 * @since 2021-01-03
 */
public interface SysCategoryTypeMapper extends BaseMapper<SysCategoryType> {

    List<SysCategoryType> getEquTypeTree( @Param("enabled")int enabled,@Param("type")String type);

    String selectMaxPath(@Param("parentPath")String parentPath,@Param("type")String type);

    int updateLeafNode(SysCategoryType temp);

    int updateByParentPath(SysCategoryType categoryType);

    int updateDelete(@Param("id")Integer id);

    int countById(@Param("id")Integer id);

    SysCategoryTypeVO selectParentEquById(@Param("parentEquId")Integer parentEquId,@Param("type")String type);

    Integer selectMaxSeq(@Param("parentPath") String parentPath, @Param("level")int level,@Param("type")String type);

    List<String> listByPath(@Param("list")List<String> list,@Param("type")String type);

    List<SysCategoryType> sysCategoryTypePath(@Param("list")List<String> list, @Param("type")String type);

    SysCategoryTypeVO selectVoById(@Param("id")int id);
}
